package com.example.demo.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serial;
import java.io.Serializable;
import java.util.Date;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;


/**
 * 用户表
 * @TableName user
 */


@Schema(description = "用户信息")
@TableName(value ="user")
@EqualsAndHashCode(callSuper = true)
@Data
public class User extends BaseEntity implements Serializable {

    @Schema(description = "用户名")
    private String username;

    @Schema(description = "密码")
    private String password;

    @Schema(description = "姓名")
    private String name;

    @Schema(description = "手机")
    private String phone;

    @Schema(description = "头像")
    private String avatar;

    @Schema(description = "描述")
    private String description;

    // 该字段查询出来同密码，不应该展示
    @Schema(description = "微信openid")
    private String wxOpenid;

    @Schema(description = "最后登录时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date lastLoginTime;

    @Schema(description = "状态")
    private Integer status;

    @Serial
    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    public static String entityTitle="用户";

    public static Map<String,String> getExcelCols(){
        Map<String,String> map=new LinkedHashMap<>();
        map.put("username","用户名");
        map.put("name","姓名");
        map.put("phone","手机");
        map.put("avatar","头像");
        map.put("description","描述");
        map.put("status","状态");
        return map;
    }
}